﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.EnterpriseLibrary.Data;
using Crystal.CLL;

namespace CrystalCommon.BLL
{
    public static class DataFactory
    {
        public static Microsoft.Practices.EnterpriseLibrary.Data.Database CreateDataBase()
        {
            // Dim db As Microsoft.Practices.EnterpriseLibrary.Data.Database
            //Try
            if (!CommonCLL.mstrConnectionstring.Equals(string.Empty))
            {
                string connStr = CommonCLL.mstrConnectionstring;
                return new Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase(connStr);
                //Return New Sql.SqlDatabase(DecriptConnectionString)
            }
            else
            {
                return null;
                //  Return db
            }
            //Catch ex As Exception
            //    Return Nothing
            //End Try

        }

    }
}
